from artifacts.base.artifacts_impl import *
from common.random_util import select_one_from_weight_map


class ArtifactsFactory:
    suit_weight_map = {
        Artifacts.SUIT_A: 50,
        Artifacts.SUIT_B: 50,
    }

    count_weight_map = {
        2: 90,
        3: 8,
        4: 2,
    }

    type_weight_map = {
        Flower: 20,
        Plume: 20,
        Clock: 20,
        Cup: 20,
        Head: 20
    }

    @staticmethod
    def create_list():
        return [select_one_from_weight_map(ArtifactsFactory.type_weight_map)(
            select_one_from_weight_map(ArtifactsFactory.suit_weight_map)) for _ in
                range(select_one_from_weight_map(ArtifactsFactory.count_weight_map))]


if __name__ == '__main__':
    for i in range(20):
        artifacts_list = ArtifactsFactory.create_list()
        for artifacts in artifacts_list:
            artifacts.upgrade_max()
            print(artifacts)
        print('----------------------------------------------')
        print()
